<template>
	<div>
		<div class="banner">
			<img class="banner-img" :src="this.bannerImg"  @click="handleBannerClick" />
			<div class="banner-info">
				<div class="banner-title">{{this.sightName}}</div>
				<div class="banner-number">
					<span class="iconfont banner-icon">&#xe60a;</span>
					<em>
						{{this.gallaryImgs.length}}
					</em>
				</div>
			</div>
		</div>
		<fade-animation>
			<common-gallary :gallaryImgs="gallaryImgs" v-show="showGallary" @close="handleGallaryClose" >
			</common-gallary>
		</fade-animation>
		
	</div>
</template>

<script type="text/javascript">
	import CommonGallary from 'common/gallary/Gallary'
	import FadeAnimation from 'common/fade/Fade'
	export default {
		name: 'Banner',
		props: {
			sightName: String,
			bannerImg: String,
			gallaryImgs: Array
		},
		methods: {
			handleBannerClick () {
				this.showGallary = true
			},
			handleGallaryClose () {
				this.showGallary = false
			}
		},
		data(){
			return {
				showGallary: false,
				imgs: [
					'http://img1.qunarzz.com/sight/p0/201303/13/9fbf3c26dce886efc8d65eac.jpg_r_800x800_77eb428e.jpg',
					'http://img1.qunarzz.com/sight/p0/201303/13/e04d246591ae6718c8d65eac.jpg_r_800x800_8ae4e5a0.jpg',
					'http://img1.qunarzz.com/sight/p0/201303/13/9fbf3c26dce886efc8d65eac.jpg_r_800x800_77eb428e.jpg',
					'http://img1.qunarzz.com/sight/p0/201303/13/e04d246591ae6718c8d65eac.jpg_r_800x800_8ae4e5a0.jpg'
				]
			}
		},
		components: {
			CommonGallary,
			FadeAnimation
		}
	};
</script>

<style lang="stylus" scoped>
	.banner
		overflow: hidden
		height: 0
		padding-bottom: 55%
		position: relative
		.banner-img
			width: 100%
		.banner-info
			position: absolute
			left: 0
			right: 0
			bottom: 0
			line-height: .6rem
			display: flex
			color: #fff
			background: linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8))
			.banner-title
				flex: 1
				font-size: .32rem
				padding:0 .2rem
			.banner-number
				box-sizing: border-box
				padding: 0 .4rem
				margin-top: .1rem
				height: .4rem
				line-height: .4rem
				border-radius: .2rem
				background: rgba(0,0,0,.5)
				font-size: .24rem
				text-align: center
				em
					margin-left: .1rem
				.banner-icon
					font-size: .24rem

</style>